<script>
	import bluetoothDevice from '@/utils/bluetooth.js'
	export default {
		data() {
			return {
				timer: null
			}
		},
		computed: {
			bluetoothStatus() {
				return this.$store.getters.bluetoothStatus
			}
		},
		onLaunch: function() {
			// if (uni.getStorageSync('MING_KEY')) {
			// 	let mingKey1 = uni.getStorageSync('MING_KEY');
			// 	let mingKey2 = parseInt(mingKey1.substring(0, 6)) + 1;
			// 	if (mingKey2 > 999999) {
			// 		mingKey2 = 112233;
			// 	}
			// 	let mingKey = mingKey1.replace(mingKey1.substring(0, 6), mingKey2);
			// 	uni.setStorageSync('MING_KEY', mingKey);
			// } else {
			// 	let mingKey11 = parseInt(key.substring(0, 6)) + 1;
			// 	let mingKey = key.replace(key.substring(0, 6), mingKey11);
			// 	uni.setStorageSync('MING_KEY', mingKey);
			// }
			const {
				statusBarHeight
			} = uni.getSystemInfoSync();
			this.topBarH = statusBarHeight;
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
			clearTimeout(this.timer)
		},
		onHide: function() {
			if (!this.$store.getters.isWxPay) {
				this.timer = setTimeout(() => {
					console.log('断开连接')
					const bluetoothObj = new bluetoothDevice()
					this.$store.commit('user/SET_BLUETOOTH_OBJ', bluetoothObj);
					bluetoothObj.disconnectBle()
				}, 5000)
			}


			console.log('App Hide')
		},
	}
</script>

<style>
	/*每个页面公共css */
	body {
		background-color: #F5F5F5;
	}

	.tab-bar-place {
		width: 100%;
		height: 140rpx;
		visibility: hidden;
	}

	.end {
		line-height: 60rpx;
		text-align: center;
		font-size: 26rpx;
		color: #999;
	}

	.no-data {
		line-height: 300rpx;
		text-align: center;
		font-size: 30rpx;
		color: #999;
	}

	.border-bottom:after {
		content: " ";
		position: absolute;
		left: 0;
		bottom: 0;
		right: 0;
		border-top: 2rpx solid #F5F5F5;
		transform: scaleY(0.5);
	}

	.border-top:before {
		content: " ";
		position: absolute;
		left: 0;
		top: 0;
		right: 0;
		z-index: 2;
		border-top: 2rpx solid #F5F5F5;
		transform: scaleY(0.5);
	}

	.ell {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	button {
		padding: 0;
		margin: 0;
		border-radius: 0;
	}

	button::after {
		display: none;
	}

	button[disabled] {
		background: #BCBCBC !important;
		color: #fff !important;
	}

	.mask {
		position: fixed;
		left: 0;
		top: 0;
		z-index: 10;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.6);
	}

	@supports (bottom: constant(safe-area-inset-bottom)) or (bottom: env(safe-area-inset-bottom)) {
		.tab-bar-place {
			height: calc(140rpx + env(safe-area-inset-bottom)) !important;
			height: calc(140rpx + constant(safe-area-inset-bottom)) !important;
		}
	}
</style>
